#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int a[6][6];
    for(int line = 0; line < n; line++)
    {
        for(int col = 0; col < n; col++)
        {
            cin >> a[line][col];
        }
    }
    bool ifFind = false;
    for(int line = 0; line < n; line++)
    {
        for(int col = 0; col < n; col++)
        {
            int cur = a[line][col];
            bool ifMax = true;
            for(int i = 0; i< n; i++)
            {
                if(a[line][i] > cur )
                {
                    ifMax = false;
                    break;
                }
            }
            bool ifMin = true;
            for(int i = 0; i< n; i++)
            {
                if(a[i][col] < cur )
                {
                    ifMin = false;
                    break;
                }
            }
            if(ifMax && ifMin)
            {
                cout <<line << " "  << col;
                ifFind  = true;
                break;
            }
        }
    }
    if(ifFind == false)
        cout << "NONE";
}